#include <string.h>

char *strcpy(char *dest,const char *src) {
	char *tmp = dest;
	int len = strlen(src);

	for (int i = 0; i < len; i++) {
		dest[i] = src[i];
	}
	dest[len] = '\0';

	return tmp;
}

#ifdef _TEST_
#include <stdio.h>

int main() {
	char str1[] = "Sample string";
	char str2[40];
	char str3[40];
	strcpy(str2, str1);
	strcpy(str3, "copy successful");
	printf("str1: %s\nstr2: %s\nstr3: %s\n", str1, str2, str3);
	return 0;
}

#endif
